package com.wwj.web.utils;

import com.wwj.web.domain.ShiroPermission;
import com.wwj.web.domain.ShiroUser;

import java.util.List;

/**
 * 该类用于封装用户的信息，包括用户的基本信息（用户名，密码，性别等）、用户角色、用户权限
 * 好处，方便在Shiro认证后把信息传给授权的方法。
 */
public class ActiviUser {
    private ShiroUser shiroUser;
    private List<String> shiroRoles;
    private List<ShiroPermission> shiroPermissions;

    public ShiroUser getShiroUser() {
        return shiroUser;
    }

    public void setShiroUser(ShiroUser shiroUser) {
        this.shiroUser = shiroUser;
    }

    public List<String> getShiroRoles() {
        return shiroRoles;
    }

    public void setShiroRoles(List<String> shiroRoles) {
        this.shiroRoles = shiroRoles;
    }

    public List<ShiroPermission> getShiroPermissions() {
        return shiroPermissions;
    }

    public void setShiroPermissions(List<ShiroPermission> shiroPermissions) {
        this.shiroPermissions = shiroPermissions;
    }

    public ActiviUser(ShiroUser shiroUser, List<String> shiroRoles, List<ShiroPermission> shiroPermissions) {
        this.shiroUser = shiroUser;
        this.shiroRoles = shiroRoles;
        this.shiroPermissions = shiroPermissions;
    }

    public ActiviUser() {
    }

    @Override
    public String toString() {
        return "ActiviUser{" +
                "shiroUser=" + shiroUser +
                ", shiroRoles=" + shiroRoles +
                ", shiroPermissions=" + shiroPermissions +
                '}';
    }
}
